package com.lm.hutool.hash;

import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.HMac;
import cn.hutool.crypto.digest.HmacAlgorithm;

public class HmacExample {
    public static void main(String[] args) {
        String text = "Hello, Hutool!";
        String key = "secretKey";

        HMac hmacSha256 = SecureUtil.hmac(HmacAlgorithm.HmacSHA256, key);
        String hmacResult = hmacSha256.digestHex(text);

        System.out.println("HMAC-SHA256: " + hmacResult);
    }
}
